import request from '@/utils/request'

export const TemplateApi = {

    /**
     *  分页
     * @returns
     */
    getPage: (data) => {
        return request({
            url: '/manage/message/template/getPage',
            data,
            method: 'post'
        })
    },

    /**
     *  删除
     * @returns
     */
    delete: (id) => {
        return request({
            url: '/manage/message/template/deleteTemplate',
            params: {id},
            method: 'get'
        })
    },

    /**
     *  更新
     * @returns
     */
    edit: (data) => {
        return request({
            url: '/manage/message/template/updateTemplate',
            data,
            method: 'post'
        })
    },

    /**
     *  插入
     * @returns
     */
    add: (data) => {
        return request({
            url: '/manage/message/template/addTemplate',
            data,
            method: 'post'
        })
    },

    /**
     *  列表
     * @returns
     */
    getEnableList: (messageType) => {
        return request({
            url: '/manage/message/template/getEnableList',
            params:{messageType},
            method: 'get'
        })
    },

    /**
     *  列表
     * @returns
     */
    syncTemplate: () => {
        return request({
            url: '/manage/message/template/syncTemplate',
            method: 'get'
        })
    },
}
